app.controller('mainSelfCtrl', ['$scope', '$http', function GridSelfController($scope, $http){
	$scope.templateType = 2; // 修改模板类型为：树+列表
	
	$scope.tree.icons_top = [];
	$scope.tree.icons_node = [{'title': '新增', 'event': 'add', 'icon': 'icon-plus-circle-fill'}];
	
	// 获取树节点数据
	$http.post('/api/inter/tsOperateOrg/ysTree', {}, {params: {}})
	.success(function (response) {
		$scope.tree.data = response.data;
	});
	
	/*
	 * 树节点点击事件
	 */
	$scope.tree.nodeClick = function(item) {
		$scope.changeExtraCond({'nodeId': item.id});
		$scope.loadPage(1);
	}
	
	/*
	 * 树节点图标点击事件
	 */
	$scope.tree.clickNodeIcon = function(event, node) {
		console.log('clickNodeIcon---', event, node);
		if(event = 'add') {
			$scope.showModalLink('/web/sys/tsOperateOrg/toAdd?pid=' + node.id);
			
		}
	}
	
}]);